/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.fullhappy.model;

import java.io.Serializable;
import java.util.ArrayList;
import javax.faces.model.SelectItem;

/**
 *
 * @author hiep
 */
public class MusicModel implements Serializable {

    private static final long serialVersionUID = 1L;
    private Integer musicId;
    private String title;
    private String description;
    private String authorIds;
    private int[] singerIds;
    private int categoryId;
    private int userCreateId;
    private short enable = (short)1 ;
    private int typeId;
    private short fileTypeId;
    private FileUpload avatarImage;
    private FileUpload sourceMusic;
    private ArrayList<SelectItem> selectSingerIdItems;
    private ArrayList<SelectItem> selectCategoryIdItems;

    public void saveSourceMusic() {
        avatarImage.saveFile();
    }
    
    public void saveAvatarImage() {
        sourceMusic.saveFile();
    }

    public Integer getMusicId() {
        return musicId;
    }

    public void setMusicId(Integer musicId) {
        this.musicId = musicId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getAuthorIds() {
        return authorIds;
    }

    public void setAuthorIds(String authorIds) {
        this.authorIds = authorIds;
    }

    public int[] getSingerIds() {
        return singerIds;
    }

    public void setSingerIds(int[] singerIds) {
        this.singerIds = singerIds;
    }
    
    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public int getUserCreateId() {
        return userCreateId;
    }

    public void setUserCreateId(int userCreateId) {
        this.userCreateId = userCreateId;
    }

    public short getEnable() {
        return enable;
    }

    public void setEnable(short enable) {
        this.enable = enable;
    }

    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

    public FileUpload getAvatarImage() {
        return avatarImage;
    }

    public void setAvatarImage(FileUpload avatarImage) {
        this.avatarImage = avatarImage;
    }

    public FileUpload getSourceMusic() {
        return sourceMusic;
    }

    public void setSourceMusic(FileUpload sourceMusic) {
        this.sourceMusic = sourceMusic;
    }
    
    public ArrayList<SelectItem> getSelectSingerIdItems() {
        return selectSingerIdItems;
    }

    public void setSelectSingerIdItems(ArrayList<SelectItem> selectSingerIdItems) {
        this.selectSingerIdItems = selectSingerIdItems;
    }

    public ArrayList<SelectItem> getSelectCategoryIdItems() {
        return selectCategoryIdItems;
    }

    public void setSelectCategoryIdItems(ArrayList<SelectItem> selectCategoryIdItems) {
        this.selectCategoryIdItems = selectCategoryIdItems;
    }

    public short getFileTypeId() {
        return fileTypeId;
    }

    public void setFileTypeId(short fileTypeId) {
        this.fileTypeId = fileTypeId;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (musicId != null ? musicId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MusicModel)) {
            return false;
        }
        MusicModel other = (MusicModel) object;
        if ((this.musicId == null && other.musicId != null) || (this.musicId != null && !this.musicId.equals(other.musicId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return title;
    }
    
}
